﻿using Autodesk.Revit.Creation;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace revitDemo
{
    public class 交点 : RevietBase
    {
        public 交点(ExternalCommandData commandData) : base(commandData)
        {
        }

        public override void Test()
        {
            //坐标系();

            var p1 = new XYZ(0,0,1);
            var p2 = new XYZ(4,0,1);

            var p10 = new XYZ(1, 0, 1);
            var p20 = new XYZ(6, 0, 1);


            var p3 = new XYZ(3,2,0);
            var p4 = new XYZ(3,-2,0);

            var l1 = Line.CreateBound(p1,p2);

            var l10 = Line.CreateBound(p10, p20);

            var l2=Line.CreateBound(p3,p4);




            var d= l1.Intersect(l10);
            TaskDialog.Show("123", d.ToString());

            if (d == SetComparisonResult.Overlap)
            {
                TaskDialog.Show("123","相交了");
            }

            OpenTransaction("22", x =>
            {
                l1.CreateModelCurve(x);
                l10.CreateModelCurve(x);



            });


        }
    }
}
